Skip to content

[publish] Copy dSYMs before disconnecting remote builds - #26905

Open
rolfbjarne wants to merge 4 commits into
mainfrom
dev/rolf/publish-dsym-remote-ordering
Open

rolfbjarne wants to merge 4 commits into
mainfrom
dev/rolf/publish-dsym-remote-ordering

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

Remote publishing runs Build through GetApplicationArtifacts, which disconnects the Pair-to-Mac session before the final dSYM copy runs. That copy uses session-aware tasks and must execute while the connection is still active.

Append _CopyDSymToPublishDirectory to _PostProcessAppBundleDependsOn in _PrePublish, so copying happens after symbol generation but before the remote build disconnects. Ordinary builds and CopyDSYMToPublishDirectory=false retain their existing behavior. Keep the final Publish dependency as a fallback; MSBuild executes the copy target only once.

The target-graph regression matrix covers Build/Publish, local/remote, and copying enabled/disabled. All eight cases pass. Removing the dependency reproduces the remote publish failure while the other seven cases still pass. This exercises the real target ordering with stubbed remote tasks, not an end-to-end Windows Pair-to-Mac build.

Related to #26847; this addresses the dSYM ordering problem separately from the application artifact metadata failure.

Note

AI/Copilot-generated. 🤖 Pull request created by Copilot

rolfbjarne and others added 3 commits October 16, 2026 19:59
Publish runs GetApplicationArtifacts, whose Build dependency disconnects the Pair-to-Mac session before returning. The subsequent session-aware dSYM copy therefore runs after the connection has closed.

Mark Apple publishing in _PrePublish and invoke the existing copy target before BeforeDisconnect. Keep its existing Publish dependency for local builds; MSBuild executes it only once remotely, and the existing copy opt-out and app-bundle guards remain unchanged.

Add a target-graph regression matrix covering Build and Publish, local and remote execution, and both CopyDSYMToPublishDirectory settings. Use the real publishing and messaging targets with stubbed remote task bodies to verify copying follows symbol generation and precedes disconnect, without requiring a Windows host or Apple workloads.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Append _CopyDSymToPublishDirectory to _PostProcessAppBundleDependsOn during _PrePublish, so symbols are copied after app post-processing and before the remote Build disconnects. This replaces the publishing flag and BeforeDisconnect wrapper while preserving ordinary Build behavior and the existing copy opt-out.

Update the ordering regression matrix to use the real shared post-processing dependency list and target. All eight cases pass; removing the new dependency reproduces the remote Publish copy-after-disconnect failure while the other seven cases still pass.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Replace null-forgiving operators in the new target-graph test with explicit root validation and Single for the required dependency element. Invalid fixtures now fail explicitly without bypassing nullable checks, following repository review rules.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 16, 2026 18:43
@rolfbjarne
rolfbjarne requested a review from dalexsoto as a code owner October 16, 2026 18:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The ordering tests use stubbed tasks, leaving actual Windows Pair-to-Mac copying unverified.

0 open findings

What changed in this PR

Moves dSYM copying earlier in the Apple SDK publish pipeline so remote builds copy symbols before disconnecting.

Changes:

  • Adds the copy target to publish-time app-bundle post-processing.
  • Adds eight ordering test cases covering Build/Publish, local/remote, and copying enabled/disabled.
File Description
tests/​dotnet/​UnitTests/​PostBuildTest.cs Adds target-ordering and copy-count regression coverage.
dotnet/​targets/​Xamarin.Shared.Sdk.Publish.targets Schedules dSYM copying before remote disconnection.

🧠 Review effort: Balanced

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@rolfbjarne rolfbjarne added backport-to-net11.0 Add this to issues or pull requests that should be backported to .NET 11 backport-to-net10.0 Add this to issues or pull requests that should be backported to .NET 10 labels Oct 19, 2026
The publish-time post-processing dependency already copies dSYMs before the remote Build disconnects. Remove the old direct dependency from Publish so post-processing is the sole scheduling point, as requested in review.

The eight target-ordering regression cases still pass, covering local and remote builds, publishing, and the copy opt-out.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 19, 2026 06:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Removing the fallback skips dSYM publishing when Build precedes Publish in the same local invocation.

1 open issue

Review effort: Balanced

Comment thread dotnet/targets/Xamarin.Shared.Sdk.Publish.targets
Comment thread dotnet/targets/Xamarin.Shared.Sdk.Publish.targets
@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 62ff35e6bb5c7027578f3f326f7bb33711af19f1 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🔥 [CI Build #62ff35e] Test results 🔥

Test results

❌ Tests failed on VSTS: test results

1 tests crashed, 4 tests failed, 214 tests passed.

Failures

❌ dotnettests tests (macOS)

1 tests failed, 0 tests passed.

Failed tests

  • DotNet tests: Failed (Execution failed with exit code 1)
    • Xamarin.Tests.BundleStructureTest.Build(MacOSX,"osx-x64",All,"Re...: '/Users/cloudtest/vss/_work/1/s/macios/tests/dotnet/BundleStructure/macOS/bin/Release/net11.0-macos/osx-x64/BundleStructure.app/...

Html Report (VSDrops) Download

❌ monotouch tests (iOS)

1 tests failed, 19 tests passed.

Failed tests

  • monotouch-test/iOS - simulator/Release (NativeAOT): Failed

Html Report (VSDrops) Download

❌ monotouch tests (macOS)

2 tests failed, 18 tests passed.

Failed tests

  • monotouch-test/macOS/Release (NativeAOT, .NET 11 defaults): Failed (Test run failed.
    Tests run: 3867 Passed: 3720 Inconclusive: 14 Failed: 2 Ignored: 145)
  • monotouch-test/macOS/Release (trimmable static registrar, NativeAOT): Failed (Test run failed.
    Tests run: 3867 Passed: 3720 Inconclusive: 14 Failed: 2 Ignored: 145)

Html Report (VSDrops) Download

❌ windows tests

🔥 Failed catastrophically on VSTS: test results - windows (no summary found).

Html Report (VSDrops) Download

Successes

✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 4 tests passed. Html Report (VSDrops) Download
✅ linker (iOS): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (tvOS): All 21 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 20 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 20 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

macOS tests

✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Golden Gate (27): All 5 tests passed. Html Report (VSDrops) Download

Linux Build Verification

✅ Linux build succeeded

Pipeline on Agent
Hash: 62ff35e6bb5c7027578f3f326f7bb33711af19f1 [PR build]

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-to-net10.0 Add this to issues or pull requests that should be backported to .NET 10 backport-to-net11.0 Add this to issues or pull requests that should be backported to .NET 11 copilot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants